x11: Don't create GdkDevices for disabled devices
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 6 Sep 2011 17:22:59 +0000 (19:22 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 6 Sep 2011 18:04:08 +0000 (20:04 +0200)
Fixes bug #658379 - Disabled devices still added to list on startup,
spotted by Bastien Nocera. Do not create GdkDevices for disabled
devices on device manager construction, leading to a confusing initial
state.

gdk/x11/gdkdevicemanager-xi2.c

index 425efeeab99430605dee448a3938865a4b74c490..c921ce00759419aa51ae208cf1c0dd241935f711 100644 (file)
@@ -417,6 +417,10 @@ gdk_x11_device_manager_xi2_constructed (GObject *object)
   for (i = 0; i < ndevices; i++)
     {
       dev = &info[i];
+
+      if (!dev->enabled)
+             continue;
+
       add_device (device_manager, dev, FALSE);
 
       if (dev->use == XIMasterPointer ||